package com.library.librarybackend.controller;

import com.library.librarybackend.domain.Result;
import com.library.librarybackend.domain.dto.UserEditFormDTO;
import com.library.librarybackend.service.UserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 平
 * @description 用户控制类
 * @since 2025-09-20 23:28
 */
@Tag(name = "用户控制类")
@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController {

    private final UserService userService;

    @Operation(summary = "编辑用户基础信息")
    @PostMapping("/edit")
    public Result<?> edit(@RequestBody @Validated UserEditFormDTO userEditFormDTO){
        userService.edit(userEditFormDTO);
        return Result.success();
    }

}
